/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package proyecto.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author sistemas
 */
@Entity
@Table(name = "transportista")
@NamedQueries({
    @NamedQuery(name = "Transportista.findAll", query = "SELECT t FROM Transportista t"),
    @NamedQuery(name = "Transportista.findByCodTransportista", query = "SELECT t FROM Transportista t WHERE t.codTransportista = :codTransportista"),
    @NamedQuery(name = "Transportista.findByNomTransportista", query = "SELECT t FROM Transportista t WHERE t.nomTransportista = :nomTransportista"),
    @NamedQuery(name = "Transportista.findByApeTransportista", query = "SELECT t FROM Transportista t WHERE t.apeTransportista = :apeTransportista"),
    @NamedQuery(name = "Transportista.findByDni", query = "SELECT t FROM Transportista t WHERE t.dni = :dni")})
public class Transportista implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "codTransportista")
    private Integer codTransportista;
    @Column(name = "nomTransportista")
    private String nomTransportista;
    @Column(name = "apeTransportista")
    private String apeTransportista;
    @Column(name = "dni")
    private Integer dni;

    public Transportista() {
    }

    public Transportista(Integer codTransportista) {
        this.codTransportista = codTransportista;
    }

    public Integer getCodTransportista() {
        return codTransportista;
    }

    public void setCodTransportista(Integer codTransportista) {
        this.codTransportista = codTransportista;
    }

    public String getNomTransportista() {
        return nomTransportista;
    }

    public void setNomTransportista(String nomTransportista) {
        this.nomTransportista = nomTransportista;
    }

    public String getApeTransportista() {
        return apeTransportista;
    }

    public void setApeTransportista(String apeTransportista) {
        this.apeTransportista = apeTransportista;
    }

    public Integer getDni() {
        return dni;
    }

    public void setDni(Integer dni) {
        this.dni = dni;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codTransportista != null ? codTransportista.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Transportista)) {
            return false;
        }
        Transportista other = (Transportista) object;
        if ((this.codTransportista == null && other.codTransportista != null) || (this.codTransportista != null && !this.codTransportista.equals(other.codTransportista))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "proyecto.modelo.Transportista[codTransportista=" + codTransportista + "]";
    }

}
